﻿<script src="~/Scripts/bootstrap-fileupload.js"></script>
@*@model List<Admin.Models.ProductDetailsModel>

@{
    ViewBag.Title = "editProductDetails";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";

}


@foreach(var id in Model)
{
    using (Html.BeginForm("Edit", "ProductDetailsAdmin", new { id = @id.MASP, enctype = "multipart/form-data",FormMethod.Post }))
    {
        @Html.AntiForgeryToken()

        <div class="form-horizontal" style="float:left;margin-left:50px; margin-top:20px; text-align:center;">

            <h3 style="text-align:center;">Sửa Sản Phẩm @id.TENSP</h3>
            <hr />
            @Html.ValidationSummary(true)
            <dl class="dl-horizontal">
                <dt>Mã sản phẩm</dt>
                <dd><label>@id.MASP</label></dd>

                <dt>Hình sản phẩm</dt>
                <dd>
                    <div class="form-horizontal">
                        <div class="form-group">

                            <div class="col-lg-8">
                                <div class="fileupload fileupload-new" data-provides="fileupload">

                                    <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 150px;min-height:100px; line-height: 20px; background-image: url(/Content/images/demoUpload.jpg);z-index:1001;">
                                        <img src="/Content/images/sanpham/@id.IMG" />
                                    </div>
                                    <div>
                                        <span class="btn btn-file">


                                            <input type="file" value="@id.IMG" name="photo" />
                                        </span>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </dd>
                

                <dt>Tên sản phẩm</dt>
                <dd><input type="text" value="@id.TENSP" name="tensp" /></dd>

                <dt>Giá cũ sản phẩm</dt>
                <dd><input type="text" value="@id.GIACU" name="giacu" /></dd>

                <dt>Giá mới sản phẩm</dt>
                <dd><input type="text" value="@id.GIAMOI" name="giamoi" /></dd>

                <dt>Saleof</dt>
                <dd><input type="text" value="@id.SALEOF" name="saleof" /></dd>

                <dt>Chủ đề</dt>
                <dd><input type="text" value="@id.CHUDE" name="chude" /></dd>

                <dt>Ngày tạo</dt>
                <dd><input type="text" value="@id.NGAYTAO" name="ngaytao" /></dd>

                <dt>Người tạo</dt>
                <dd><input type="text" value="@id.NGUOITAO" name="nguoitao" /></dd>
            </dl>

            <div class="form-group">
                <div class="col-md-offset-2 col-md-10">
                    <input type="submit" value="Save" class="btn btn-default" />
                    @Html.ActionLink("Quay lại danh sách", "ProductDetails", "ProductDetailsAdmin")
                </div>

            </div>
        </div>
    }
}*@
@model List<Admin.Models.ProductDetailsModel>

@{
    ViewBag.Title = "editProduct";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";

}


@foreach (var id in Model)
{
    using (Html.BeginForm("editProductDetails", "ProductDetailsAdmin", FormMethod.Post, new { id = @id.MASP, enctype = "multipart/form-data" }))
    {
        @Html.AntiForgeryToken()

    <div class="formtable" style="float:left;margin-left:50px; margin-top:20px;width:800px; text-align:center;">

        <h3 style="text-align:center;">Sửa Sản Phẩm @id.TENSP</h3>
        <hr />
        @Html.ValidationSummary(true)
        <dl class="dl-horizontal">
            <dt>Mã sản phẩm</dt>
            <dd>@id.MASP</dd>
            <dt>Hình sản phẩm</dt>
            <dd>
                <div class="form-horizontal">
                    <div class="form-group">

                        <div class="col-lg-8">
                            <div class="fileupload fileupload-new" data-provides="fileupload">
                                
                                <div class="fileupload-preview fileupload-exists thumbnail" style="box-shadow: 5px 5px 5px #888888; max-width: 150px; min-height: 100px; line-height: 20px; background-image: url(/Content/images/demoUpload.jpg); z-index: 1001;">
                                    <img src="/Content/images/sanpham/@id.IMG" />
                                    
                                </div>
                                <div>
                                    <span class="btn btn-file">


                                        <input type="file" name="photo1" value="@id.IMG" />
                                        <input type="hidden" name="photo1" value="@id.IMG" />
                                        <b style="color:red;">@ViewBag.Error</b>
                                    </span>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </dd>

            <dt>Tên sản phẩm</dt>
            <dd><input type="text" value="@id.TENSP" name="tensp" /></dd>

            <dt>Giá cũ sản phẩm</dt>
            <dd><input type="text" value="@id.GIACU" name="giacu" /></dd>

            <dt>Giá mới sản phẩm</dt>
            <dd><input type="text" value="@id.GIAMOI" name="giamoi" /></dd>

            <dt>Saleof</dt>
            <dd><input type="text" value="@id.SALEOF" name="saleof" /></dd>

            <dt>Chủ đề</dt>
            <dd><input type="text" value="@id.CHUDE" name="chude" /></dd>

            <dt>Ngày tạo</dt>
            <dd><input type="date" name="ngaytao" value="@id.NGAYTAO" />
                
            </dd>

            <dt>Người tạo</dt>
            <dd><input type="text" value="@id.NGUOITAO" name="nguoitao" /></dd>
        </dl>

        <div class="form-group" style="width:550px;">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" class="btn btn-default" />
                @Html.ActionLink("Quay lại danh sách", "ProductDetails", "ProductDetailsAdmin")
            </div>

        </div>
    </div>
    }
}
